<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="基于hexo的个人技术博客搭建 —— 基于GitHub的多设备Hexo博客编写, python,machine learning,deep learning,html,css,c,c++,cpp,cmake,ros,linux,ubuntu">
    <meta name="description" content="前面我们经过了一系列的配置，成功的运行起来了我们的博客。本文将介绍如何在多设备上进行博客的管理">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>基于hexo的个人技术博客搭建 —— 基于GitHub的多设备Hexo博客编写 | JackWang&#39;s Blog</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 5.4.2">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css">
<link rel="stylesheet" href="/css/prism-line-numbers.css" type="text/css"></head>



   <style>
    body{
       background-image: url(https://cdn.jsdelivr.net/gh/Tokisaki-Galaxy/res/site/medias/background.jpg);
       background-repeat:no-repeat;
       background-size: 100% 100%;
       background-attachment:fixed;
    }
</style>



<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">JackWang&#39;s Blog</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="" class="waves-effect waves-light">

      
      <i class="fas fa-book-reader" style="zoom: 0.6;"></i>
      
      <span>博客</span>
      <i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
    </a>
    <ul class="sub-nav menus_item_child ">
      
      <li>
        <a href="/tags">
          
          <i class="fas fa-tags" style="margin-top: -20px; zoom: 0.6;"></i>
          
	  <span>按标签归类文章</span>
        </a>
      </li>
      
      <li>
        <a href="/categories">
          
          <i class="fas fa-bookmark" style="margin-top: -20px; zoom: 0.6;"></i>
          
	  <span>按目录归类文章</span>
        </a>
      </li>
      
      <li>
        <a href="/archives">
          
          <i class="fas fa-archive" style="margin-top: -20px; zoom: 0.6;"></i>
          
	  <span>按日期分类文章</span>
        </a>
      </li>
      
    </ul>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>



<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">JackWang&#39;s Blog</div>
        <div class="logo-desc">
            
            JackWang的个人博客
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="javascript:;">
			
				<i class="fa-fw fas fa-book-reader"></i>
			
			博客
			<span class="m-icon"><i class="fas fa-chevron-right"></i></span>
		</a>
            <ul  style="background:  ;" >
              
                <li>

                  <a href="/tags " style="margin-left:75px">
				  
				   <i class="fa fas fa-tags" style="position: absolute;left:50px" ></i>
			      
                              <span>按标签归类文章</    span>

                  </a>
                </li>
              
                <li>

                  <a href="/categories " style="margin-left:75px">
				  
				   <i class="fa fas fa-bookmark" style="position: absolute;left:50px" ></i>
			      
                              <span>按目录归类文章</    span>

                  </a>
                </li>
              
                <li>

                  <a href="/archives " style="margin-left:75px">
				  
				   <i class="fa fas fa-archive" style="position: absolute;left:50px" ></i>
			      
                              <span>按日期分类文章</    span>

                  </a>
                </li>
              
            </ul>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        
    </ul>
</div>


        </div>

        
    </nav>

</header>

    
<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = '';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('抱歉，这篇文章并不想让所有人都看到，请输入授权密码观看')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/';
            }
        }
    })();
</script>




<div class="bg-cover pd-header post-cover" style="background-image: url('https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719161615280.png')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">基于hexo的个人技术博客搭建 —— 基于GitHub的多设备Hexo博客编写</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/Hexo/">
                                <span class="chip bg-color">Hexo</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/Hexo%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" class="post-category">
                                Hexo博客搭建
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2022-07-19
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2023-06-01
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    3.1k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    11 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719161615280.png" alt="基于GitHub的多设备Hexo博客管理"></p>
<h1 id="基于hexo的个人技术博客搭建-——-基于GitHub的多设备Hexo博编写"><a href="#基于hexo的个人技术博客搭建-——-基于GitHub的多设备Hexo博编写" class="headerlink" title="基于hexo的个人技术博客搭建 —— 基于GitHub的多设备Hexo博编写"></a>基于hexo的个人技术博客搭建 —— 基于GitHub的多设备Hexo博编写</h1><p>终于，经过了千辛万苦，我们成功的搭建起来了我们博客网站的远程仓库、本地编写环境。我们可以愉快的开始写作的任务了。</p>
<p>然而目前依旧存在一个重要的问题，这个问题严重的影响了我们的写作，具体来说就是多设备上的Hexo博客管理。而之所以会出现这个问题，其实是和Hexo网站的运行原理是息息相关的，因此本文就将介绍如何在多设备上进行Hexo博客网站的管理。</p>
<h2 id="1-Hexo博客网站的运行原理"><a href="#1-Hexo博客网站的运行原理" class="headerlink" title="1. Hexo博客网站的运行原理"></a>1. Hexo博客网站的运行原理</h2><p>在前面介绍过，hexo博客网站其实就是一个文件夹，这个文件夹下包含我们写的文章的MarkDown源文件、网站的配置文件、根据MarkDown生成HTML网页的库、生成的静态网页……</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719162717537.png" alt="Hexo博客的文件夹"></p>
<p>而Hexo的运行原理，或者说工作流程是这样的：</p>
<h3 id="1-编写MarkDown源文件"><a href="#1-编写MarkDown源文件" class="headerlink" title="1. 编写MarkDown源文件"></a>1. 编写MarkDown源文件</h3><ol>
<li><p><strong>首先我们编写博客文章的MarkDown源文件</strong>，所有的MarkDown源文件会放在<code>source</code>文件夹下。更详细的解释如下：</p>
<ul>
<li><p>根据<strong>博客文章</strong>具体的类型不同（草稿Draft还是正式发布的文章Post），将会放在<code>source</code>文件夹下不同的位置（对应<code>source/_drafts</code>和<code>source/_posts</code>）。</p>
</li>
<li><p>此外，博客网站除了博客文章的页面以外，还会存在一些非博客文章页面，例如我的博客的<code>关于</code>页面。针对这些非博客文章的页面，Hexo也是利用MarkDown来管理的</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719163752702.png" alt="非博客文章页面：我的博客的关于页面"></p>
</li>
<li><p>因此，最终在<code>source</code>文件夹下存在博客文章MarkDown，而我们的博客文章MarkDown就会放在<code>source/_drafts</code>和<code>source/_posts</code>两个文件夹下</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719164152852.png" alt="source文件夹最终的结构"></p>
</li>
</ul>
</li>
</ol>
<h3 id="2-生成静态网页"><a href="#2-生成静态网页" class="headerlink" title="2. 生成静态网页"></a>2. 生成静态网页</h3><ol>
<li><p><strong>在我们写好了文章的MarkDown源文件之后，利用hexo gen生成网站的静态网页</strong>，生成的静态网页就会放在<code>public</code>文件夹下。具体来说：</p>
<ul>
<li><p>Hexo首先会利用MarkDown引擎来解析我们在<code>source</code>文件夹下的所有的MarkDown源文件</p>
</li>
<li><p>然后Hexo会利用主题的HTML模板来生成对应的网页，例如我用的是<code>matery</code>主题，那么Hexo就会利用<code>matery</code>主题中的HTML模板来生成博客文章页面。</p>
</li>
<li><p>生成完所有的页面后，Hexo会把所有的网页放在<code>public</code>文件夹下。而<code>public</code>文件夹下的所有网页就是我们看到的博客网站。例如我们利用浏览器打开<code>public/index.html</code>就可以看到网站的首页。只不过由于路径的问题，一些<code>JavaSacript</code>插件没有加载，所以看起来不太对劲。</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719165317092.png" alt="public/index.html就是我们的博客网站的首页"></p>
</li>
</ul>
</li>
</ol>
<h3 id="3-运行-部署-托管网站"><a href="#3-运行-部署-托管网站" class="headerlink" title="3. 运行/部署/托管网站"></a>3. 运行/部署/托管网站</h3><ol>
<li><p>生成完所有的网页之后，通过hexo server运行网站或者通过hexo deploy部署网站。这两种方式对应着两种不同的网站的运行方式</p>
<ul>
<li><p>hexo server运行网站其实就是在本地解析、渲染<code>public</code>文件夹中的网页，然后暴露到本机的4000端口上去。这样的话我们如果在具有公网IP的服务器上运行Hexo，别人就可以通过<code>公网IP:4000</code>端口访问到我们的网站。在此基础上，我们如果购买了域名<code>xxx.xxx.xxx</code>并且进行了域名解析，别人就可以以<code>xxx.xxx.xxx:4000</code>的形式访问我们的网站。</p>
</li>
<li><p>hexo deploy则将会把<code>public</code>文件夹上传到GitHub的<code>用户名.github.io</code>仓库中。GitHub的Pages功能允许每一个用户创建一个名为<code>用户名.github.io</code>的仓库。用户在这个仓库上传静态的HTML网页，GitHub在<code>用户名.github.io</code>仓库中如果发现了<code>index.html</code>的文件，那么别人如果访问<code>http://用户名.github.com</code>，GitHub就会将<code>index.html</code>作为网站的首页显示出去，别人在<code>index.html</code>中点击按钮跳转，GitHub同样就会把对应的网页显示出去。</p>
</li>
</ul>
</li>
</ol>
<p>对于我们个人来说，低成本的网站搭建方案当然就是把博客部署到GitHub上去。因为把网站托管到GitHub上，用户访问网站看到的网页都是GitHub帮我们展示的。自然而然，GitHub就会帮助我们防御诸如DDos之类的网站攻击。</p>
<p>如果要使用第一种方式，在有公网IP的服务器上部署博客网站的话，首先购买有公网IP的服务器就不便宜，其次还需要自己设置防火墙、进行网站攻击的防御等等。</p>
<p><strong>因为我们是为了建立个人博客网站，所以自然而然就会选择把网站部署到GitHub上去，省时省力省钱</strong>。关于如何把Hexo网站部署到GitHub上去，这样的文章一查一大把，我这里就不展开了，因为本文的目的不是介绍如何把Hexo博客网站托管到GitHub上去，自行查阅即可（当然不排除以后会写一篇文章来专门讲解，这里先挖个坑吧）。</p>
<h2 id="2-基于GitHub的多设备Hexo博客书写"><a href="#2-基于GitHub的多设备Hexo博客书写" class="headerlink" title="2. 基于GitHub的多设备Hexo博客书写"></a>2. 基于GitHub的多设备Hexo博客书写</h2><blockquote>
<p>前面铺垫了这么多，终于开始进入本文的主题了~</p>
</blockquote>
<p>经过前面的介绍，你应该已经明白了Hexo博客的运行原理了。下面我们就来介绍多设备Hexo博客网站管理的原理以及方法。</p>
<p>因为我们经常会遇到的一个场景就是：<strong>我们想在不同的设备上写博客</strong>，所以我们就需要对Hexo博客网站进行多设备管理，即在不同的设备上进行博客的管理。而前面介绍了，<strong>Hexo博客网站的本质，其实就是一个包含了网站静态网页、博客源代码和必要博客框架在内的文件夹（或者说项目文件夹，其实都没啥问题）</strong>。因此我们Hexo博客网站进行多设备管理，其实就是要对这个文件夹进行管理。</p>
<p>我们如果想要在多个设备上编写博客、发布博客，就意味着我们需要在多个不同的设备上同步我们的博客项目。因此，我们首先需要了解一下Hexo博客文件夹的组成。</p>
<h3 id="1-Hexo博客文件夹的组成"><a href="#1-Hexo博客文件夹的组成" class="headerlink" title="1. Hexo博客文件夹的组成"></a>1. Hexo博客文件夹的组成</h3><p>对于我们进行Hexo博客管理来说，我们只关注几个重要的、对我们有意义的文件/文件夹即可。</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719162717537.png" alt="Hexo博客的文件夹"></p>
<p>具体来说，一些需要注意的文件如下：</p>
<ol>
<li><p>public和souce文件夹：前面介绍过，这两个文件夹主要装的就是网站博客的源代码和生成的网站的静态网页</p>
</li>
<li><p>ssl文件：ssl文件夹主要存放了网站的ssl证书，这样对读者来说就可以以<code>https://xxx.xxx.xxx</code>的形式访问网站</p>
</li>
<li><p>scaffolds和layout文件夹：这两个文件夹是Hexo博客默认主题的配置文件，不用管</p>
</li>
<li><p>node_module文件夹：因为我们的网站利用了不同的node.js的包来完成网页的渲染，所以这个文件夹下就放了网站依赖的node.js的包</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719183141808.png" alt="node_module存放了网站依赖的node.js包"></p>
</li>
<li><p>theme文件夹：这个文件夹中存放了我们下载的所有主题。例如我只下载了<code>matery</code>主题，所以这个文件夹下只有一个<code>hexo-theme-matery</code>文件夹</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719181554556.png" alt="theme文件夹下存放了网站的主题"></p>
</li>
<li><p>package.json和package-lock.json：因为我们的网站利用了不同的node.js的包来完成网页的渲染，因此这两个文件就记录了我们的网站依赖的node.js的包<img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719181852212.png" alt="package.json和package-lock.json保存网站以来的node.js包"></p>
</li>
<li><p>db.json：这个文件主要记录了我们的网站的文件，例如有哪些css资源、那些文章等等。<img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719182349751.png" alt="db.json的内容"></p>
</li>
<li><p>_config.yml：这个文件记录了我们的hexo博客的配置，注意hexo博客的配置和主题的配置是不一样的，主题的配置会放在<code>theme/主题/config.yml</code>下。当然有的主题也会放在根目录下，比如我这里的<code>_config.landscape.yml</code>保存的就是默认的landscape主题的配置文件。</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719182616508.png" alt="_config.yml的一些内容"></p>
</li>
</ol>
<h3 id="2-管理原理"><a href="#2-管理原理" class="headerlink" title="2. 管理原理"></a>2. 管理原理</h3><p>我们如果想要在多个设备上编写博客、发布博客，就意味着我们需要在多个设备上具有相同的Hexo博客的环境，因此，我们其实只需要把一些关键的文件在不同的设备上同步，就可以在多个不同的设备上搭建出相同的Hexo博客网站。接着我们就可以愉快的开始写博客了。</p>
<p>经过上面的介绍，其实我们也明白了那些文件是需要同步的，具体来说我们要同步的文件一定有：</p>
<ul>
<li>说明网站以来的node.js包的package相关文件</li>
<li>博客的MarkDown源代码在source文件夹</li>
</ul>
<p>而我们不需要的同步的文件夹有：</p>
<ul>
<li>node.js的包，即<code>node_modules</code>，新设备上重新下载即可</li>
<li>网站的静态网页文件，即<code>public</code>，新设备上重新生成即可</li>
<li>部署到github上的中间文件，即<code>.deploy_xxx</code></li>
</ul>
<p>而说到多个设备上同步不同的文件，最好用的工具自然而然就是<code>git</code>了，所以同样，我们利用<code>git</code>和GitHub来管理博客网站，并且在多个设备上进行同步。</p>
<h2 id="3-多设备管理Hexo博客"><a href="#3-多设备管理Hexo博客" class="headerlink" title="3. 多设备管理Hexo博客"></a>3. 多设备管理Hexo博客</h2><p>下面就介绍具体的步骤</p>
<h3 id="1-创建新的分支"><a href="#1-创建新的分支" class="headerlink" title="1. 创建新的分支"></a>1. 创建新的分支</h3><p>hexo博客网站的静态网页是放在<code>用户名.github.io</code>仓库的<code>master</code>分支下的，因此我们这里创建一个新的分支，不新建仓库，而后将博客所有需要同步的文件放在新的分支中。</p>
<p>但要注意，如果源代码中有私密信息，就不适合这样管理了，因为发布到<code>用户名.github.io</code>仓库要求是<code>public</code>的，这样别人才能看到你的网页，因此<code>用户名.github.io</code>仓库中的信息是可以完全公开访问，如果有诸如密码之类的信息就还是不要这样管理了，新开一个private的仓库存放就行。</p>
<p>这里使用创建新分支的方式来管理，所以首先在Github网页的仓库上创建新的分支，如下图</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719185524908.png" alt="创建新分支-1"></p>
<p>然后新建一个名为<code>hexo</code>的分支，我这里是已经创建之后的样子</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719185615064.png" alt="创建新分支-2"></p>
<h3 id="2-设置新分支为默认分支"><a href="#2-设置新分支为默认分支" class="headerlink" title="2. 设置新分支为默认分支"></a>2. 设置新分支为默认分支</h3><p>设置为默认分支主要是为了在其他设备上clone方便，其实设置不设置问题不大</p>
<p>要设置的话先点击setting</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719185825024.png" alt="设置新分支为默认分支-1"></p>
<p>然后在branch下选择新的分支</p>
<p><img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719190051619.png" alt="设置新分支为默认分支-2"></p>
<h3 id="3-拉取分支到本地并添加所有需要保存的文件"><a href="#3-拉取分支到本地并添加所有需要保存的文件" class="headerlink" title="3. 拉取分支到本地并添加所有需要保存的文件"></a>3. 拉取分支到本地并添加所有需要保存的文件</h3><p>在本地Hexo项目文件夹下运行</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">git</span> remote add github https://github.com/JackWang0107/JackWang0107.github.io.git
<span class="token function">git</span> pull github hexo
<span class="token function">git</span> checkout hexo
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p>这样就把hexo分支拉取过来了并且切换到这个分支了</p>
<p>我们接下来新建一个<code>.gitignore</code>文件忽略所有不需要同步的文件</p>
<pre class="line-numbers language-bash"><code class="language-bash">vim .gitignore
<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>内容如下</p>
<pre class="line-numbers language-txt"><code class="language-txt">.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h3 id="4-删除静态网页文件并添加所有需要保存的文件"><a href="#4-删除静态网页文件并添加所有需要保存的文件" class="headerlink" title="4. 删除静态网页文件并添加所有需要保存的文件"></a>4. 删除静态网页文件并添加所有需要保存的文件</h3><p>因为我们的hexo分支是从master分支中创建出来的，而master分支中保存了网站的静态网页，这些文件我们显然是不需要的，因此先删除这些文件。</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">git</span> <span class="token function">rm</span> -r 2021 2022 about archives categories contact css friends js libs medias page tags <span class="token function">test</span> 404.html CNAME favicon.png favicon.svg favicon1.png index.html search.xml
<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p>然后添加博客网站的所有需要同步的文件</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">git</span> add <span class="token keyword">.</span>
<span class="token function">git</span> commit -a --message<span class="token operator">=</span><span class="token string">"sync the website"</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<h3 id="5-推送到GitHub"><a href="#5-推送到GitHub" class="headerlink" title="5. 推送到GitHub"></a>5. 推送到GitHub</h3><p>接下来，我们把新的分支推送到Github上即可，不过需要注意的是，由于hexo分支是在github上新建的，因此拉取到本地的时候这个分支和远程分支之间没有历史关系，推送的时候需要加上允许无历史关系的推送这个参数</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">git</span> push github hexo --allow-unrelated-histories
<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h3 id="6-新设备上同步博客"><a href="#6-新设备上同步博客" class="headerlink" title="6. 新设备上同步博客"></a>6. 新设备上同步博客</h3><p>接下来我们在新的设备上同步博客</p>
<p>在新的设备上，首先克隆项目</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">git</span> clone 项目链接
<span class="token function">git</span> checkout hexo
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p>然后安装hexo以及依赖的其他node.js包</p>
<pre class="line-numbers language-bash"><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> hexo-cli -g
<span class="token function">npm</span> <span class="token function">install</span>
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<p>然后就在新的设备上愉快的开始编写博客了。</p>
<p>最后，需要注意的就是有一些博客的主题是需要配置的，这样的话就需要额外把该主题的配置文件添加进来，具体的步骤和前面一样，这里就不赘述了。</p>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">Jack Wang</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://jackwang0107.github.io/2022/07/19/ji-yu-hexo-de-ge-ren-ji-zhu-bo-ke-da-jian-part-6-ji-yu-git-de-duo-she-bei-bo-ke-guan-li-md/">https://jackwang0107.github.io/2022/07/19/ji-yu-hexo-de-ge-ren-ji-zhu-bo-ke-da-jian-part-6-ji-yu-git-de-duo-she-bei-bo-ke-guan-li-md/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">Jack Wang</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/Hexo/">
                                    <span class="chip bg-color">Hexo</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.png" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.jpg" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2022/07/19/zui-jin-de-yi-xie-qing-kuang-2/">
                    <div class="card-image">
                        
                        <img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/image-20220719220756291.png" class="responsive-img" alt="最近的一些情况-2.md">
                        
                        <span class="card-title">最近的一些情况-2.md</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            本文记录了我的一些最近的情况
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2022-07-19
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E6%9D%82%E9%A1%B9/" class="post-category">
                                    杂项
                                </a>
                            
                            <a href="/categories/%E6%9D%82%E9%A1%B9/%E4%B8%AA%E4%BA%BA%E6%83%85%E5%86%B5/" class="post-category">
                                    个人情况
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%9D%82%E9%A1%B9/">
                        <span class="chip bg-color">杂项</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2022/03/07/xjtu-ji-suan-ji-shi-jue-2022-spring-3-cheng-xiang-yuan-li/">
                    <div class="card-image">
                        
                        <img src="https://jack-1307599355.cos.ap-shanghai.myqcloud.com/img/image-20220306215122381.png" class="responsive-img" alt="XJTU计算机视觉2022-Spring-3: 成像原理与相机模型">
                        
                        <span class="card-title">XJTU计算机视觉2022-Spring-3: 成像原理与相机模型</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            本文是XJTU计算机视觉2022-Spring第三节课的笔记
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2022-03-07
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/XJTU%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%892022-Spring/" class="post-category">
                                    XJTU计算机视觉2022-Spring
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/">
                        <span class="chip bg-color">计算机视觉</span>
                    </a>
                    
                    <a href="/tags/%E6%A8%A1%E5%BC%8F%E8%AF%86%E5%88%AB/">
                        <span class="chip bg-color">模式识别</span>
                    </a>
                    
                    <a href="/tags/Computer-Vision/">
                        <span class="chip bg-color">Computer Vision</span>
                    </a>
                    
                    <a href="/tags/Pattern-Recognition/">
                        <span class="chip bg-color">Pattern Recognition</span>
                    </a>
                    
                    <a href="/tags/Imaging-Principle/">
                        <span class="chip bg-color">Imaging Principle</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE' || selection.getRangeAt(0).commonAncestorContainer.nodeName === 'CODE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: JackWang&#39;s Blog<br />'
            + '文章作者: Jack Wang<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('2'),
            headingSelector: 'h1, h2, h3, h4, h5, h6'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h1, h2, h3, h4, h5, h6').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    

    <div class="container row center-align"
         style="margin-bottom: 15px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2021-2023</span>
            
            <a href="/about" target="_blank">Jack Wang</a>
            <!-- |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a> -->
            <!-- |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a> -->
            <br>
            
                &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                        class="white-color">603.8k</span>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
                <span id="sitetime"> Loading ...</span>
                <script>
                    var calcSiteTime = function () {
                        var seconds = 1000;
                        var minutes = seconds * 60;
                        var hours = minutes * 60;
                        var days = hours * 24;
                        var years = days * 365;
                        var today = new Date();
                        var startYear = "2021";
                        var startMonth = "11";
                        var startDate = "12";
                        var startHour = "0";
                        var startMinute = "0";
                        var startSecond = "0";
                        var todayYear = today.getFullYear();
                        var todayMonth = today.getMonth() + 1;
                        var todayDate = today.getDate();
                        var todayHour = today.getHours();
                        var todayMinute = today.getMinutes();
                        var todaySecond = today.getSeconds();
                        var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond);
                        var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
                        var diff = t2 - t1;
                        var diffYears = Math.floor(diff / years);
                        var diffDays = Math.floor((diff / days) - diffYears * 365);

                        // 区分是否有年份.
                        var language = 'zh-CN';
                        if (startYear === String(todayYear)) {
                            document.getElementById("year").innerHTML = todayYear;
                            var daysTip = 'This site has been running for ' + diffDays + ' days';
                            if (language === 'zh-CN') {
                                daysTip = '本站已运行 ' + diffDays + ' 天';
                            } else if (language === 'zh-HK') {
                                daysTip = '本站已運行 ' + diffDays + ' 天';
                            }
                            document.getElementById("sitetime").innerHTML = daysTip;
                        } else {
                            document.getElementById("year").innerHTML = startYear + " - " + todayYear;
                            var yearsAndDaysTip = 'This site has been running for ' + diffYears + ' years and '
                                + diffDays + ' days';
                            if (language === 'zh-CN') {
                                yearsAndDaysTip = '本站已运行 ' + diffYears + ' 年 ' + diffDays + ' 天';
                            } else if (language === 'zh-HK') {
                                yearsAndDaysTip = '本站已運行 ' + diffYears + ' 年 ' + diffDays + ' 天';
                            }
                            document.getElementById("sitetime").innerHTML = yearsAndDaysTip;
                        }
                    }

                    calcSiteTime();
                </script>
            
            <br>
            
                <span id="icp"><img src="/medias/icp.png"
                                    style="vertical-align: text-bottom;"/>
                <a href="https://beian.miit.gov.cn" target="_blank">陕ICP备2021014294号-1</a>
            </span>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/jackwang0108" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2232123545@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2232123545" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2232123545" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    

    
        
        <script type="text/javascript">
            // 只在桌面版网页启用特效
            var windowWidth = $(window).width();
            if (windowWidth > 768) {
                document.write('<script type="text/javascript" src="/libs/others/sakura.js"><\/script>');
            }
        </script>
    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
